//
//  TKL_BlogreVC.m
//  TKL_EnPro
//
//  Created by 雅恩三河科技 on 2019/4/19.
//  Copyright © 2019年 MrZhang. All rights reserved.
//

//
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//                  \./                  \\`.
//        .'//                     |                     \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
//    .'//.-"                 `-.  |  .-'                 "-.\\`.
//  .'//______.============-..   \ | /   ..-============.______\\`.
//.'______________________________\|/______________________________`.
//
//

#import "TKL_BlogreVC.h"

#import "Head.h"
@interface TKL_BlogreVC ()<UITextViewDelegate>
@property(nonatomic,strong)UITextView* inputText;
@property(nonatomic,strong)UILabel* topLab;
@property(nonatomic,strong)UIButton* loginBtn;
@end

@implementation TKL_BlogreVC
#pragma mark - getter and setter
-(UIButton *)loginBtn
{
    if (!_loginBtn) {
        _loginBtn = [[UIButton alloc]init];
        _loginBtn.frame = WFCGRectMake(36, 196+[self topShelterHeight], 303, 41);
        [_loginBtn setTitle:@"提交" forState:UIControlStateNormal];
        [_loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_loginBtn setBackgroundColor:Main_Color forState:UIControlStateNormal];
        [WFFunctions WFUIaddbordertoView:_loginBtn radius:WFCGFloatY(41/2) width:0 color:[UIColor clearColor]];
        _loginBtn.titleLabel.font = SYSTEMFONT(16);
        @WeakSelf;
        [_loginBtn handleControlEvent:UIControlEventTouchUpInside withBlock:^{
            if ([WFFunctions WFStrCheckEmpty:selfp.inputText.text]) {
                [FTIndicator showErrorWithMessage:@"请输入您的举报"];
            }else
            {
                [selfp requestCityData];
            }
        }];
    }
    return _loginBtn;
}

-(UILabel *)topLab
{
    if (!_topLab) {
        _topLab=[UILabel new];
        _topLab.x=WFCGFloatX(15);
        _topLab.y=WFCGFloatY(0)+[self topShelterHeight];
        _topLab.width=SCREEN_WIDTH-WFCGFloatX(30);
        _topLab.height=WFCGFloatY(33);
        _topLab.font=SYSTEMFONT(15);
        _topLab.textColor=HEXCOLOR(@"#666666");
        _topLab.text=@"举报内容";
    }
    return _topLab;
}
-(UITextView *)inputText
{
    if (!_inputText) {
        _inputText=[[UITextView alloc] init];
        _inputText.delegate=self;
        _inputText.x=0;
        _inputText.y=WFCGFloatY(33)+[self topShelterHeight];
        _inputText.width=SCREEN_WIDTH;
        _inputText.height=WFCGFloatY(100);
        _inputText.placeholder=@"请输入您的投诉或建议....";
        _inputText.font=SYSTEMFONT(15);
    }
    return _inputText;
}
#pragma mark - event
#pragma mark - method
-(void)initilization
{
    [self setNavgationTheme:0];
    [self viewModelBand];
    self.extendedLayoutIncludesOpaqueBars = YES;
    self.navigationItem.title = @"举报";
    [self.view addSubview:self.inputText];
    [self.view addSubview:self.topLab];
    [self.view addSubview:self.loginBtn];
}
-(void)viewModelBand
{
    
}
-(void)reloadData
{
    
}
-(void)reloadView
{
    
}
#pragma mark - life
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initilization];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */
#pragma mark - delegate
-(void)requestCityData
{
    @WeakSelf;
    //
    //http://101.201.171.131:8080/rest/api/community/comment/add
    NSMutableDictionary* para=[NSMutableDictionary new];
    [para setObject:selfp.inputText.text forKey:@"content"];
    [para setObject:[TKL_LoginViewModel shareInterface].infoModel.uuid forKey:@"userUuid"];
    
    
    [[InterfaceManager shareInterface] requestAllInterface:@"http://101.201.171.131:8080/rest/api/user/report/add" para:para handler:^(NSDictionary *info, InterfaceStatusModel *infoModel) {
        [FTIndicator showSuccessWithMessage:@"感谢您的举报,我们会尽快处理"];
        [selfp.navigationController popViewControllerAnimated:YES];
    }];
}

@end


/*
 11111111111111111111111111111111111111001111111111111111111111111
 11111111111111111111111111111111111100011111111111111111111111111
 11111111111111111111111111111111100001111111111111111111111111111
 11111111111111111111111111111110000111111111111111111111111111111
 11111111111111111111111111111000000111111111111111111111111111111
 11111111111111111111111111100000011110001100000000000000011111111
 11111111111111111100000000000000000000000000000000011111111111111
 11111111111111110111000000000000000000000000000011111111111111111
 11111111111111111111111000000000000000000000000000000000111111111
 11111111111111111110000000000000000000000000000000111111111111111
 11111111111111111100011100000000000000000000000000000111111111111
 11111111111111100000110000000000011000000000000000000011111111111
 11111111111111000000000000000100111100000000000001100000111111111
 11111111110000000000000000001110111110000000000000111000011111111
 11111111000000000000000000011111111100000000000000011110001111111
 11111110000000011111111111111111111100000000000000001111100111111
 11111111000001111111111111111111110000000000000000001111111111111
 11111111110111111111111111111100000000000000000000000111111111111
 11111111111111110000000000000000000000000000000000000111111111111
 11111111111111111100000000000000000000000000001100000111111111111
 11111111111111000000000000000000000000000000111100000111111111111
 11111111111000000000000000000000000000000001111110000111111111111
 11111111100000000000000000000000000000001111111110000111111111111
 11111110000000000000000000000000000000111111111110000111111111111
 11111100000000000000000001110000001111111111111110001111111111111
 11111000000000000000011111111111111111111111111110011111111111111
 11110000000000000001111111111111111100111111111111111111111111111
 11100000000000000011111111111111111111100001111111111111111111111
 11100000000001000111111111111111111111111000001111111111111111111
 11000000000001100111111111111111111111111110000000111111111111111
 11000000000000111011111111111100011111000011100000001111111111111
 11000000000000011111111111111111000111110000000000000011111111111
 11000000000000000011111111111111000000000000000000000000111111111
 11001000000000000000001111111110000000000000000000000000001111111
 11100110000000000001111111110000000000000000111000000000000111111
 11110110000000000000000000000000000000000111111111110000000011111
 11111110000000000000000000000000000000001111111111111100000001111
 11111110000010000000000000000001100000000111011111111110000001111
 11111111000111110000000000000111110000000000111111111110110000111
 11111110001111111100010000000001111100000111111111111111110000111
 11111110001111111111111110000000111111100000000111111111111000111
 11111111001111111111111111111000000111111111111111111111111100011
 11111111101111111111111111111110000111111111111111111111111001111
 11111111111111111111111111111110001111111111111111111111100111111
 11111111111111111111111111111111001111111111111111111111001111111
 11111111111111111111111111111111100111111111111111111111111111111
 11111111111111111111111111111111110111111111111111111111111111111
 
 
 */
